﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharedGenomics.Workbench.Core
{
    public class LoginPrompt : ILoginPrompt
    {
        public LoginPrompt(IApplicationController viewDisplay, ILoginPresenter presenter)
        {
            this.AppController = viewDisplay;
            this.Presenter = presenter;
        }

        public bool Login()
        {
            //display the login form modally
            this.AppController.ShowPresenter(this.Presenter, FormDisplayMode.ModalDialog);

            //presenter will be updated if the user logged in successfully
            return this.Presenter.IsLoggedIn;
        }

        private IApplicationController AppController { get; set; }
        private ILoginPresenter Presenter { get; set; }
    }
}
